package com.hd.trans.share;


import androidx.annotation.Nullable;

import org.jetbrains.annotations.NotNull;

import retrofit2.Retrofit;


/**
 * Retrofit请求提供类
 */
public class SingleRetrofitProvider {
    @Nullable
    private static SingleRetrofit instance;

    private SingleRetrofitProvider() {
        // for safe
    }

    @NotNull
    public static SingleRetrofit getInstance() {
        if (instance == null) {
            instance = new SingleRetrofit();
        }
        return instance;
    }

    public static class SingleRetrofit {
        /***
         * 一般请求地址 {@link HttpServerProperties#BASE_URL()}
         */
        @NotNull
        private final Retrofit baseUrlRetrofit;
//        /***
//         * 云存储请求 {@link HttpServerProperties#BASE_CLOUD_URL()}
//         */
//        @NotNull
//        private final Retrofit baseCloudUrlRetrofit;
        /***
         * ocpc请求 {@link HttpServerProperties# BASE_OCPC()}
         */
//        @NotNull
//        private final Retrofit baseOcpcRetrofit;

        private SingleRetrofit() {
            baseUrlRetrofit = RetrofitUtil.initRetrofit(HttpServerProperties.BASE_URL());
//            baseOcpcRetrofit = RetrofitUtil.initRetrofit(HttpServerProperties.BASE_OCPC(), null, 3, 3);
//            baseCloudUrlRetrofit = RetrofitUtil.initRetrofit(HttpServerProperties.BASE_CLOUD_URL());
        }

//        @NotNull
//        public Retrofit getBaseOcpcRetrofit() {
//            return baseOcpcRetrofit;
//        }
//
//        @NotNull
//        public Retrofit getBaseCloudUrlRetrofit() {
//            return baseCloudUrlRetrofit;
//        }

        @NotNull
        public Retrofit getBaseUrlRetrofit() {
            return baseUrlRetrofit;
        }
    }

}

